package cn.yuyiling.jelly.kg.mongodb.entity;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.Date;
import java.util.List;


@Document(collection = "knowledge_points")
@Data
@NoArgsConstructor
public class KnowledgePoint implements Serializable {
    @Id
    private String id;

    private String type = "knowledge_point";

    @Field("parent_id")
    private String parentId;

    private String path;

    private int depth;

    @Field("created_at")
    private Date createdAt;

    @Field("created_by")
    private String createdBy;

    @Field("updated_at")
    private Date updatedAt;

    @Field("updated_by")
    private String updatedBy;

    private String name;

    private String content;

    private String category;

    private Metadata metadata;


    @Data
    @NoArgsConstructor
    public static class Metadata implements Serializable {
        @Field("ai_evaluation")
        private Double aiEvaluation;

        private boolean flagged;

        private List<String> tags;
    }
}